package com.frinder.wx.base.api.tuling.callback;

import com.frinder.wx.base.api.tuling.ITuLingService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @ClassName TuLingServiceHandler
 * @Description //TODO
 * @Author frinder
 * @Date 2018/12/6 15:22
 * @Version 1.0
 */
@Slf4j
@Component
public class TuLingServiceFallbackFactory implements FallbackFactory<ITuLingService> {

    @Override
    public ITuLingService create(Throwable e) {
        log.error("*** 请求图灵接口失败，原因：{}", e.getMessage(), e);
        return request -> "调用服务失败";
    }
}
